﻿using System;
using System.Dynamic;
using System.Threading.Tasks;
namespace JESAI.Platform.AutoUpdate;

/// <summary>
/// API 结果
/// </summary>
public partial class ApiResult 
{
    /// <summary>
    /// 初始化一个<see cref="ApiResult"/>类型的实例
    /// </summary>
    /// <param name="code">错误码</param>
    /// <param name="message">消息</param>
    /// <param name="data">数据</param>
    public ApiResult(int code, string message, dynamic? data = null)
    {
        Code = code;
        Message = message;
        Data = data;
        OperationTime = DateTime.Now;
    }

    /// <summary>
    /// 状态码
    /// </summary>
    public int Code { get; }

    /// <summary>
    /// 消息
    /// </summary>
    public string Message { get; }

    /// <summary>
    /// 数据
    /// </summary>
    public dynamic? Data { get; }

    /// <summary>
    /// 操作时间
    /// </summary>
    public DateTime OperationTime { get; }
}
